﻿<!--#include file="const.inc"-->
<%
'====================================================================
' 感谢使用晴天3G智能建站系统..
' 作者:梁永强.QQ:766750857
' 官方网址:wap.qt3g.com
' 声明:软件版权归作者所有,没有经过作者本人同意不得非法破解和传播本程序
'====================================================================
%>

<%	dim rs,sql,i,name,listid,page,fleg,namee

    		Page = Request("page")      '上级页数
    		If Page = "" Then Page = 1
   		If Not IsNumeric(Page) Then Page = 1
    		Page = CLng(Page)
    		If Page < 1 Then Page = 1


	listid=Request.QueryString("listid")
	if listid="" then listid=0
	if not isnumeric(listid) then listid=0
	listid=clng(listid)

	Set Rs = Server.CreateObject("Adodb.Recordset")

	Sql = "select name,fleg from qingtian_class where id="&listid
	Rs.Open Sql,conn,1,1
	if not (rs.bof and rs.eof)  then
		fleg=rs("fleg")
		Namee=qingtian.utf8(rs("Name"))
	end if
	Rs.close

		
select case v
case "0"
we0="<br/>"
hr="-----------<br/>"
%>
<card title="<%=namee%>"><p align="<%=qingtian.px%>">
<%
case "1"
hr=""
zi="<span style=""color:#FF5500"">"
zi0="</span>"
we="<div class=""footer"">"
sou="<div class=""block4"">"
dao="<div class=""navi"">"
we0="</div>"
ziz="<div style=""background-color:#FF5226;color:#E1E100"">"
%>
<title><%=namee%></title>
</head>
<body>
<!--#include virtual="/css.inc"-->
<%
End Select		



%><%


		if sid="Null" then
		%>
<%
		else
		qingtian.info
		end if


		Sql = "select [id],[name],[ext],[urls],[img],[br],[content],[vipgm] from qingtian_class where fleg="&listid&" and yinz=0 order by [pid] asc"
		Rs.Open Sql,conn,1,1
		if not (rs.bof and rs.eof)  then
		For i=1 to rs.RecordCount

		select case rs("ext")
			case 0
                                if rs("vipgm")=0 then
				%><a href="tian.asp?id=<%=rs("id")%>&amp;sid=<%=sidd%>"><%=qingtian.utf8(rs("name"))%></a><%
                                else
					%><a href="/html/main<%=rs("id")%>.asp?sid=<%=sidd%>"><%=qingtian.utf8(rs("name"))%></a><%
                                end if
				if rs("br")=1 then
					%><br/><%
				end if
			case 1
				%><%=qingtian.utf8(rs("name"))%><%
				if rs("br")=1 then
					%><br/><%
				end if
			case 2
				%><a href="<%=qingtian.utf8(rs("urls"))%>"><%=qingtian.utf8(rs("name"))%></a><%
				if rs("br")=1 then
					%><br/><%
				end if
			case 3
				if rs("content")="[end]" then
				qingtian.tuichu
				end if
				%>
<!--#include virtual="/inc/cssdate.inc"-->
<%=cp.ubbshow(qingtian.wml(content))%>
<%
				if rs("br")=1 then
					%><br/><%
				end if
			case 4
				if len(rs("urls"))>0 then
				%><a href="<%=qingtian.utf8(rs("urls"))%>"><img src="<%=qingtian.utf8(rs("img"))%>" alt=''/></a><%
				else
				end if
				%><img src="<%=qingtian.utf8(rs("img"))%>" alt=''/><%
				if rs("br")=1 then
					%><br/><%
				end if
			case 5
				%><a href="view.asp?id=<%=rs("id")%>&amp;sid=<%=sidd%>"><%=qingtian.utf8(rs("name"))%></a><%
				if rs("br")=1 then
					%><br/><%
				end if
			case 6
				%><a href="fileli.asp?listid=<%=rs("id")%>&amp;sid=<%=sidd%>"><%=qingtian.utf8(rs("name"))%></a><%
				if rs("br")=1 then
					%><br/><%
				else
					%>|<%
				end if
			case 7
                                if rs("vipgm")=0 then
				%><a href="viewli.asp?listid=<%=rs("id")%>&amp;sid=<%=sidd%>"><%=qingtian.utf8(rs("name"))%></a><%
                                else
					%><a href="/html/main<%=rs("id")%>.asp?sid=<%=sidd%>"><%=qingtian.utf8(rs("name"))%></a><%
                                end if
				if rs("br")=1 then
					%><br/><%
				else
					%>|<%
				end if
			case 8
				%><a href="photoli.asp?listid=<%=rs("id")%>&amp;sid=<%=sidd%>"><%=qingtian.utf8(rs("name"))%></a><%
				if rs("br")=1 then
					%><br/><%
				else
					%>|<%
				end if

		end select
                Rs.MoveNext
		next  
                else
                bookkk="" & we & "该栏目还没添加任何文章！"&we0&""
		end if
		Rs.close
		Sql = "select id,name,ReadCount from qingtian_viewli where   classid="&listid&"   order by id desc"


		Rs.Open Sql,conn,1,1



		if not (rs.bof and rs.eof)  then
%>
                <%=dao%><a href="search_view.asp?sid=<%=sidd%>">搜索</a>.<a href="newli.asp?listid=<%=listid%>&amp;act=2&amp;sid=<%=sidd%>">最新</a>.<a href="downli.asp?act=2&amp;listid=<%=listid%>&amp;sid=<%=sidd%>">最热</a>.<a href="tuijianli.asp?act=2&amp;listid=<%=listid%>&amp;sid=<%=sidd%>">推荐</a><%=we0%><%=ziz%><%=namee%>文章列表<%=we0%><%=hr%>
<%
				Rs.PageSize = 15	'一页N条记录
				IF Not IsEmpty(Page) Then
					IF Not IsNumeric(Page) Then		'判断Page是否为数字
						Page=1
					Else
						Page=Cint(Page)		'转换成短整形Integer
					End IF
					IF Page > Rs.PageCount Then
						Rs.AbsolutePage = Rs.PageCount	'设置上级显示页等于最后一页
					ElseIF Page <= 0 Then
						Rs.AbsolutePage = 1		'设置上级页等于第一页
					Else
						Rs.AbsolutePage = Page	'如果大于零,显示上级页等于接收的页数
					End IF
				Else
					Rs.AbsolutePage = 1
				End IF
				Page = Rs.AbsolutePage


		For i=1 to  Rs.PageSize
		If Rs.Eof Then
			exit For
		End If
			%>
			<%
dat=i+(page-1)*Rs.PageSize
dat1=dat mod 2
if dat1=0 then
                       %><%=we%><%=dat%>.<a href="articview.asp?id=<%=rs(0)%>&amp;sid=<%=sidd%>"><%=qingtian.utf8(rs(1))%></a>阅读(<%=rs(2)%>)<%=we0%>
<%
else
%>
<%=sou%><%=dat%>.<a href="articview.asp?id=<%=rs(0)%>&amp;sid=<%=sidd%>"><%=qingtian.utf8(rs(1))%></a>阅读(<%=rs(2)%>)<%=we0%>
<%
end if
	 	Rs.MoveNext
	  	Next
%>
<%=hr%>
<%
                if rs.PageCount>1 then
                    Response.Write we
                end if
   		'分页
    		If Page < rs.PageCount Then
    		    Response.Write("<a href='viewli.asp?listid="&listid&"&amp;page=" & Page + 1 & "&amp;sid="&sidd&"'>下页</a>")
    		End If
       
    		If Page > 1 And Page < rs.PageCount Then
    		    Response.Write(" ")
    		End If
        
    		If Page > 1 Then
    		    Response.Write("<a href='viewli.asp?listid="&listid&"&amp;page=" & Page - 1 & "&amp;sid="&sidd&"'>上页</a>第"&Page&"/"&rs.PageCount&"页," & we0 & "")
    		Elseif rs.PageCount >1 then
    		    Response.Write("第"&Page&"/"&rs.PageCount&"页," & we0 & "")
    		End If
            
    		Randomize()
    
    		If rs.PageCount > 2 Then
                Randomize()
                if v=0 then
     		    Response.Write("共"&rs.RecordCount&"条<input name='Page' format='*N' size='2' maxlength='5'/><anchor>GO&gt;&gt;<go href='viewli.asp?listid="&listid&"&amp;run=" & Int((9999) * Rnd() + 1) & "&amp;sid="&sidd&"' method='post'><postfield name=""Page"" value=""$(Page:n)"" /></go></anchor><br/>")
                else
     		    Response.Write("<form action=""viewli.asp?listid="&listid&"&run=" & Int((9999) * Rnd() + 1) & "&amp;sid="&sidd&""" method=""post"">共"&rs.RecordCount&"条<input type=""text"" name=""Page"" value="""" format=""*N"" size=""2"" maxlength=""5""/><input type=""submit"" value=""GO&gt;&gt;"" /></form><br/>")
                end if
    		End If
                else
                    Response.Write bookkk
		end if
		Rs.close
			
	if fleg>0 then
		Sql = "select top 1 [name],[ext],[vipgm] from qingtian_class where id="&fleg&""
		Rs.Open Sql,conn,1,1
		if not (rs.bof and rs.eof)  then
			name=rs("name")
			select case rs("ext")
			case 0
                        if rs("vipgm")=0 then
			%><%=sou%>上级栏目&gt;<a href="tian.asp?id=<%=fleg%>&amp;sid=<%=sidd%>"><%=qingtian.utf8(name)%></a><%=we0%><%
                        else
			%><%=sou%>上级栏目&gt;<a href="/html/main<%=fleg%>.asp?sid=<%=sidd%>"><%=qingtian.utf8(name)%></a><%=we0%><%
                        end if
			case 6
			%><%=sou%>上级栏目&gt;<a href="fileli.asp?listid=<%=fleg%>&amp;sid=<%=sidd%>"><%=qingtian.utf8(name)%></a><%=we0%><%
			case 7
                        if rs("vipgm")=0 then
			%><%=sou%>上级栏目&gt;<a href="viewli.asp?listid=<%=fleg%>&amp;sid=<%=sidd%>"><%=qingtian.utf8(name)%></a><%=we0%><%
                        else
			%><%=sou%>上级栏目&gt;<a href="/html/main<%=fleg%>.asp?sid=<%=sidd%>"><%=qingtian.utf8(name)%></a><%=we0%><%
                        end if
			case 8
			%><%=sou%>上级栏目&gt;<a href="photoli.asp?listid=<%=fleg%>&amp;sid=<%=sidd%>"><%=qingtian.utf8(name)%></a><%=we0%><%
			case else
			%><%=sou%>上级栏目&gt;<a href="viewli.asp?id=<%=fleg%>&amp;sid=<%=sidd%>"><%=qingtian.utf8(name)%></a><%=we0%><%
			end select
		end if
		Rs.close

	end if
	set rs=nothing


%>

<%
end Function
%>
